function [] = booth_encoding_tb()
    D = 11;
    A = [-1 -1];
    B = dec2bin(D)-48;
    Y = booth_encoding(B);
    assert(D,Y,A);

    D = 7;
    A = [2 -1];
    B = dec2bin(D)-48;
    Y = booth_encoding(B);
    assert(D,Y,A);

    D = 5;
    A = [1 1];
    B = dec2bin(D)-48;
    Y = booth_encoding(B);
    assert(D,Y,A);

    D = 57;
    A = [0 -2 1];
    B = dec2bin(D)-48;
    Y = booth_encoding(B);
    assert(D,Y,A);

    D = 64;
    A = [1 0 0 0];
    B = dec2bin(D)-48;
    Y = booth_encoding(B);
    assert(D,Y,A);

    D = 1234;
    A = [1 1 -1 1 1 -2];
    B = dec2bin(D)-48;
    Y = booth_encoding(B);
    assert(D,Y,A);

    D = 254;
    A = [0 0 0 -2];
    B = dec2bin(D)-48;
    Y = booth_encoding(B);
    assert(D,Y,A);
end

function [] = assert(A,B,C)
    if(B == C)
        fprintf('\tYes: %d => %s\n',A,mat2str(B));
    else
        fprintf('\tNo : %d => %s, correct is: %s\n',A,mat2str(B),mat2str(C));       
    end
end